<template>
  <div class="ruok-header">
      <div class="header-back" @click="back" v-if='!noBack'></div>
      <div class="header-title">{{title}}</div>
      <div class="headerRight" v-if="rightTitle" @click='headerRightClick'>{{rightTitle}}</div>
  </div>
</template>

<script>
export default {
  name: 'backHeader',
  props: ['title', 'rightTitle', 'rightClick', 'noBack'],
  data () {
    return {
    }
  },
  methods: {
    back () {
      this.$router.go(-1)
    },
    headerRightClick () {
      this.rightClick()
    }
  },
  created () {}
}
</script>
<style lang="less" rel="stylesheet/less" scoped>
.ruok-header {
    position:relative;
    height: 40px;
    background: -webkit-linear-gradient(45deg,#9067ff,#ff78d2);
    position: relative;
    width: 100%;
}
.header-back, .header-custom {
    display: block;
    position: absolute;
    top: 50%;
    -webkit-transform: translate3d(0,-50%,0);
    transform: translate3d(0,-50%,0);
}
.header-back {
    background: url("~images/icon/back.png") no-repeat;
    width: 16px;
    height: 20px;
    background-position: 50%;
    background-size: contain;
    left: 16px;
}
.header-title,.headerRight{
    line-height: 40px;
    color: #fff;
    text-align: center;
    font-size: 16px;
    letter-spacing: 1px;
    padding: 0 40px;
    overflow: hidden;
    -o-text-overflow: ellipsis;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.headerRight{
    position: absolute;
    top:0px;
    right:-20px;
}
</style>
